<#import "../macros/spring.ftl" as spring />
 
<#macro menu index>
	<#if m_site.m_user??>
		<div class="subnav cf">
			<span >&#9776;</span>
			<ul>
				<#if m_site.m_user.privileges == 1>
					<li class="item <#if index == "0">active</#if>">
						<a href="<@spring.url '/users/' />">Users</a>
					</li>
					<li class="item <#if index == "1">active</#if>">
						<a href="<@spring.url '/exams/' />">Exams</a>
					</li>
					<li class="item <#if index == "2">active</#if>">
						<a href="<@spring.url '/questions/' />">Questions</a>
					</li>
					<li class="item <#if index == "3">active</#if>">
						<a href="<@spring.url '/profiles/' />">Profiles</a>
					</li>
					<li class="item <#if index == "4">active</#if>">
						<a href="<@spring.url '/topics/' />">Topics</a>
					</li>
					<li class="item <#if index == "5">active</#if>">
						<a href="<@spring.url '/account' />">My account</a>
					</li>
					<li class="item <#if index == "6">active</#if>">
						<a href="<@spring.url '/history/' />">History</a>
					</li>
				</#if>
				<#if m_site.m_user.privileges == 2>
					<li class="item <#if index == "0">active</#if>">
						<a href="<@spring.url '/account' />"></a>My account
					</li>
				</#if>
			</ul>
		</div>
	</#if>
</#macro>

<#macro cssLinks section="" subsection="">
	<meta charset="utf-8">
	<meta http-equiv="content-language" content="en-US">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<#if !isDesktop()>
		<link rel="apple-touch-icon-precomposed">
	<#else>
		<link href="/images/favicon.ico" rel="shortcut icon"/>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	</#if>

	<#if isMobile()>
		<style type="text/css">
			<#include "../www/css/phone.min.css">
			<#include "../www/css/bootstrap/bootstrap.css">
			<#include "../www/css/bootstrap/bootstrap-theme.css">
			<#include "../www/css/${section}/phone.min.css">
			<#if subsection != ""> 
				<#include "../www/css/${subsection}/phone.min.css">
			</#if>
		</style>
	<#else>
		<#if isTablet()>
			<link rel="stylesheet" href="/css/tablet.min.css"/>
			<link rel="stylesheet" href="/css/${section}/tablet.min.css"/>
			<#if subsection != ""> 
				<link rel="stylesheet" href="/css/${subsection}/tablet.min.css"/>
			</#if>
		<#else>
			<link rel="stylesheet" href="<@spring.url '/css/desktop.min.css' />">
			<link rel="stylesheet" href="<@spring.url '/css/${section}/desktop.min.css'/> "/>
			<#if subsection != ""> 
				<link rel="stylesheet" href="<@spring.url '/css/${subsection}/desktop.min.css'/> "/>
			</#if>	
		</#if>
		<link rel="stylesheet" href="<@spring.url '/css/bootstrap/bootstrap-theme.css'/> "/>
		<link rel="stylesheet" href="<@spring.url '/css/bootstrap/bootstrap.css'/> "/>
		<script type="text/javascript" src="<@spring.url '/js/base.min.js'/> "></script>
		<script type="text/javascript" src="<@spring.url '/js/libs/bootstrap.js'/> "></script>
	</#if>
</#macro>